package com.itheima.handler;

import com.itheima.doamin.ResultInfo;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@ResponseBody
public class CommonExceptionHandler {

    @ExceptionHandler(Exception.class)
    public ResultInfo ex(Exception e){
        e.printStackTrace();
        return new ResultInfo().error("网络崩溃了");
    }
}
